<template>
  <div class="header">
    <div class="header-left">
      <div class="iconfont back-icon">&#xe624;</div>
    </div>
    <div class="header-center">
      <span class="iconfont search-icon">&#xe632;</span>
      输入城市/景点/游玩主题
    </div>
    <router-link to="/city">
      <div class="header-right">
        {{this.currentCity}}
        <span class="iconfont arrow-icon">&#xe6aa;</span>
      </div>
    </router-link>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState({
      currentCity: 'city'
    })
  }
}
</script>

<style lang="stylus" scoped>
  @import "~styles/varibles.styl"
  .header
    height $headerHeight
    line-height $headerHeight
    display flex
    background $bgColor
    .header-left
      float left
      width .6rem
      color #fff
      .back-icon
        text-align center
        font-size .36rem
    .header-center
      flex 1
      background #fff
      margin .14rem 0 .14rem .2rem
      line-height .6rem
      color $txtColor
      padding-left .2rem
      .search-icon
        font-size .28rem
    .header-right
      float right
      min-width 1.24rem
      padding 0 .1rem
      color #fff
      text-align: center
      .arrow-icon
        margin-left -.04rem
        font-size .24rem
</style>
